<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1"> 
    <title>供应商列表</title> 
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/uimaker/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/uimaker/icon.css">
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/style.css">
	<style type="text/css">
		.layui-layer-success .layui-layer-title {
		    background: rgb(30,147,30);
		    color: #fff;
		    border: none
		}
		
		.layui-layer-success .layui-layer-btn a {
		    background: rgb(30,147,30);
		    border-color: rgb(30,147,30);
		}
		
		.layui-layer-success .layui-layer-btn .layui-layer-btn1 {
		    background: #92B8B1
		}
		
		.layui-layer-error .layui-layer-title {
		    background: #f0ad4e;
		    color: #fff;
		    border: none
		}
		
		.layui-layer-error .layui-layer-btn a {
		    background: #f0ad4e;
		    border-color: #f0ad4e;
		}
		
		.layui-layer-error .layui-layer-btn .layui-layer-btn1 {
		    background: #92B8B1
		}
	</style>
</head> 
<body>
	<form action="${ctx}/order/hx" method="post" class="form0">
	    <div class="container">
	      <div id="tb" style="padding:30px 30px;">
	        <div class="conditions">
	            <span class="con-span">核销码:</span><input class="easyui-textbox" id="hxm" type="text" name="hxm" style="width:166px;height:35px;line-height:35px;"></input>
	            <a class="easyui-linkbutton submit-btn" iconCls="icon-search" data-options="selected:true">核销</a>
	            <a class="easyui-linkbutton submit-reset" iconCls="icon-reload">重置</a>
	        </div>
	      </div>
	    </div>
    </form>
    <script type="text/javascript" src="${ctx}/static/js/jquery.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/layer/layer.js"></script>
    <script type="text/javascript">
        $(function(){
        	$(".submit-btn").on('click', function() {
        		var $hxm = $('#hxm');
        		if ($.trim($hxm.textbox('getValue')) == '') {
        			layer.alert('核销码不能是空，请输入核销码！', {
            			  skin: 'layui-layer-error', 
            			  closeBtn: 0
            			});
        			return;
        		}
        		$(".form0").submit();
        	});
        	
        	$('.submit-reset').on('click', function() {
        		$('#hxm').textbox('setValue', '');
        	});
        });    

        $(function() {
        	<c:if test="${not empty successMessage}">
        		layer.alert('${successMessage}', {
        			  skin: 'layui-layer-success', 
        			  closeBtn: 0
        			});
        	</c:if>
        	<c:if test="${not empty errorMessage}">
	    		layer.alert('${errorMessage}', {
      			  skin: 'layui-layer-error', 
      			  closeBtn: 0
      			});
	    	</c:if>
        });
    </script>
</body> 
</html>